<%-- 
    Document   : room_booking_status
    Created on : Nov 9, 2012, 5:45:03 AM
    Author     : durva
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Book Room</title>
        <script type="text/javascript">
	   
		function fwdToServlet(i){
			document.roomBooking.roomtype.value = document.getElementById("roomtype"+i).value;
                        document.roomBooking.price.value = document.getElementById("roomtype"+i).value;
                        document.roomBooking.no.value = document.getElementById("no"+i).options[document.getElementById("no"+i).selectedIndex].value;
                        
                        document.roomBooking.action = "getaddons";
                        document.roomBooking.method = "post";
                        document.roomBooking.submit();
		}
	   
	   </script>
        
    </head>
    <body>
       
        <form name="roomBooking">
            
            <input type="hidden" name="roomtype" id="roomtype" value=""/>
            <input type="hidden" name="price" id="price" value=""/>
            <input type="hidden" name="no" id="no" value=""/>
            <!--<input type="hidden" name="" id="" value=""/>-->
            
            <%
            int i=0;
            %>
            <div>
                <c:forEach items="${rooms}" var="room">
                    <%
                        i=i+1;
                    %>
                <table>
                    <tr>
                        <td> Room Type:<input type="label" name="roomtype<%=i%>" id="roomtype<%=i%>" value="${room.roomtype}"/></td>
                        <td> No. of Rooms: <select name="no<%=i%>" id="no<%=i%>"> 
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                            </select></td>
                    </tr>
                </table>
               
            </div>
            <div>
                Photo:<img></img>
            </div>
                       
                               <div>
                                    Facility:<input type="label" name="facility<%=i%>" id="facility<%=i%>" value="${room.facilityname}" readonly="true"/>
                                </div>
                               
            <div>
                Price:<input type="label" name="price<%=i%>" id="price<%=i%>" value="${room.price}"readonly="true" border="0"/>
            </div>
            <div>
                Description:<input type="label" name="description<%=i%>" id="description<%=i%>" value="${room.roomtypedesc}" readonly="true"/>
            </div>
             <div><input name="Submit" type="button" value="Book now" id="btnSave" onClick="fwdToServlet('<%=i%>')" /></div>

                                     
                </c:forEach>
            
           
       
            
        </form>
    </body>
</html>